package data.nanjing.expo.models.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import data.nanjing.expo.common.DateTimeUtil;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * Created by zjp on 2018/6/12.
 *
 * 活动报名信息列表
 * 用于用户报名某个活动时存储信息
 * 对应表名:activity_apply_info
 * 添加报名时，部门和职位非必填项
 * 姓名和手机号必填
 *
 */
public class ActivityApplyInfo {

    private Integer id; //主键

    @NotNull(message = "请选择报名的活动")
    private Integer activityId;    //对应的主键id

    private Integer userId; //报名用户的id

    //@NotNull(message = "报名用户不能为空")
    private String userName;    //报名用户的姓名

    //@NotNull(message = "手机号不能为空")
    private String userPhone;   //手机号

    private String userDepart;  //部门

    private String userDuty;    //职位

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date createTime;    //创建时间

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm",timezone = "GMT+8")
    private Date updateTime;    //更新时间

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getActivityId() {
        return activityId;
    }

    public void setActivityId(Integer activityId) {
        this.activityId = activityId;
    }

    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getUserDepart() {
        return userDepart;
    }

    public void setUserDepart(String userDepart) {
        this.userDepart = userDepart;
    }

    public String getUserDuty() {
        return userDuty;
    }

    public void setUserDuty(String userDuty) {
        this.userDuty = userDuty;
    }

    public String getCreateTime() {
        return DateTimeUtil.dateFormat(createTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getUpdateTime() {
        return DateTimeUtil.dateFormat(updateTime, DateTimeUtil.MINUTE_PATTERN);
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public String toString() {
        return "ActivityApplyInfo{" +
                "id=" + id +
                ", activityId=" + activityId +
                ", userId=" + userId +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                '}';
    }
}
